package com.lepu.app.fun.hospital.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class HospitalAdvice implements Serializable{
	private static final long serialVersionUID = 1L;
	public String DCQID;
	public String QuestionContent;
	public String StaffID;
	public String StaffName;
	public String Category;
	public String RecordCreateTime;
	public String ReplyStatus;
	public String IsClosed;
    public ArrayList<Reply>  ReplyList;
	
	
    public static ArrayList<HospitalAdvice> parseJsonData(String dataString) {
        String result = "";
        try {
            JSONObject jsonObject = new JSONObject(dataString);
            JSONObject obj1 = (JSONObject) jsonObject.get("Result");
            JSONArray dataArray = obj1.getJSONArray("ListInfo");

            result = dataArray.toString();
        } catch (JSONException e) {
            e.printStackTrace();
        }

        Gson gson = new Gson();
        ArrayList<HospitalAdvice> testArraylist = gson.fromJson(result,new TypeToken<List<HospitalAdvice>>() {}.getType());
        return testArraylist;
    }
	
    public static class Reply implements Serializable{
		private static final long serialVersionUID = 1L;
		public String ReplyTime;
    	public String ReplyContent;
    	public String UserID;
    	public String StaffID;
    	public String ContentType;
    	public String Width;
    	public String Height;
    	
        public static ArrayList<Reply> parseJsonData(String dataString) {
            String result = "";
            try {
                JSONObject jsonObject = new JSONObject(dataString);
                JSONObject obj1 = (JSONObject) jsonObject.get("Result");
                JSONArray dataArray = obj1.getJSONArray("ListInfo");

                result = dataArray.toString();
            } catch (JSONException e) {
                e.printStackTrace();
            }

            Gson gson = new Gson();
            ArrayList<Reply> arraylist = gson.fromJson(result,new TypeToken<List<Reply>>() {}.getType());
            return arraylist;
        }
    }


}
